package com.hxjc.bankagent.json;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * TestJson
 *
 * @author yinz
 * @date 2018/5/11
 */
public class TestJson {
    public static void main(String[] args) {
        ObjectMapper mapper = new ObjectMapper();
//        String jsonInString = "{'name' : 'mkyong'}";
        //JSON from String to Object
        Staff obj = new Staff("teststaff");
        try {
            String jsonInString = mapper.writeValueAsString(obj);
            System.out.println(jsonInString);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
    }
}
